package com.yonyou.pmclouds.milestone.service;

import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.milestone.entity.MilestoneRefVO;
import com.yonyou.pmclouds.milestone.entity.MilestoneVO;

import java.util.Map;

/**
 * @author th
 * @date 2019/11/6 15:20
 */
public interface IMilestoneQuery {

    /**
     * 查询租户下的里程碑
     *
     * @param pkTenant 租户
     * @param enableStatus 启用状态
     * @param keyword 关键字
     * @return
     * @throws BusinessException
     */
    MilestoneVO[] queryByTenant(String pkTenant, Byte enableStatus, String keyword) throws BusinessException;

    /**
     * 查询里程碑是否被计划引用
     *
     * @param pk
     * @return
     * @throws BusinessException
     */
    Boolean referenceCheck(String pk) throws BusinessException;

    /**
     * 查询租户下的里程碑，返回参照VO
     *
     * @param pkTenant
     * @param keyword
     * @return
     */
    MilestoneRefVO[] queryRefByTenant(String pkTenant, String keyword) throws BusinessException;

    /**
     * 通过主键查询里程碑名称
     *
     * @param ids
     * @return
     * @throws BusinessException
     */
    Map<String, String> queryNameById(String[] ids) throws BusinessException;

    /**
     * 通过编码查询里程碑
     *
     * @param codes
     * @param pkTenant
     * @return
     * @throws BusinessException
     */
    Map<String, MilestoneVO> queryByCodes(String[] codes, String pkTenant) throws BusinessException;
}
